package com.kid.keep.exception;

import com.kid.keep.enums.BizExceptionEnum;
import com.honeybee.cloud.framework.base.exception.business.BaseBizException;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description 业务基础异常
 * @Author DELL
 * @Create 2018-12-08
 * @Since 1.0.0
 */
@Slf4j
public class BizException extends BaseBizException {
    public static BaseBizException getInstance(BizExceptionEnum exceptionEnum) {
        return new BaseBizException(exceptionEnum.getParentCode(), exceptionEnum.getSubCode(), exceptionEnum.getParentMessage(), exceptionEnum.getMessage());
    }

    public static BaseBizException getInstance(BizExceptionEnum exceptionEnum,Object data) {
        return new BaseBizException(exceptionEnum.getParentCode(), exceptionEnum.getSubCode(), exceptionEnum.getParentMessage(), exceptionEnum.getMessage(),data);
    }
}
